package com.yao.yaoojbackendjudgeservice.judge.codesandbox.controller.inner;

import com.yao.yaoojbackendjudgeservice.judge.JudgeService;
import com.yao.yaoojbackendmodel.model.entity.QuestionSubmit;
import com.yao.yaoojbackendserviceclient.service.JudgeFeignClient;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

//该服务仅内部调用，不是给前端的
@RestController
@RequestMapping("/inner")
public class JudgeinnerController implements JudgeFeignClient {

    @Resource
    private JudgeService judgeService;

    /**
     * 判题
     * @param questionSubmitId
     * @return
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") Long questionSubmitId){
        return judgeService.doJudge(questionSubmitId);
    }
}
